import 'package:flutter/material.dart';
import 'package:x3_base_package/x3_base_package.dart';
import 'package:x3_business_core/business_customer/ful_components/business_customer_details_coupons_scheme_item.dart';

class BusinessCustomerDetailsServiceCoupons extends StatelessWidget {

  static final String sName = 'BusinessCustomerDetailsServiceCoupons';

  @override
  Widget build(BuildContext context) {
    dynamic arguments = BaseRouterUtil.getArguments(context);
    String title = BaseUtils.getKeyData(arguments, 'title').toString();
    return BaseScaffoldComponent(title: title, child: _buildMainScaffold(context, arguments));
  }

  Widget _buildMainScaffold(BuildContext context, dynamic arguments) {
    String inputApi = BaseUtils.getKeyData(arguments, 'inputApi').toString();
    String vipId = BaseUtils.getKeyData(arguments, 'vipId').toString();
    return BaseRefreshComponent(
      path: inputApi,
      params: {'vipId': vipId},
      controller: new BaseRefreshController(),
      buildItem: (Map<String, dynamic> item, int index) {
        return BaseCardComponent(
          child: BusinessCustomerDetailsCouponsSchemeItem( item: item, couponState: '0' ),
        );
      },
    );
  }

}
